<template>
  <div class="game">
    <h2>热门游戏列表</h2>
    <!-- slot 将数据传递给插槽的使用者 -->
    <slot name="qwe" :games="games" a="哈哈我是作用域插槽"></slot>
  </div>
</template>

<script setup lang="ts" name="Game">
import { reactive } from "vue";
// 数据
let games = reactive([
  { id: "asv1", name: "王者荣耀" },
  { id: "asv2", name: "英雄联盟" },
  { id: "asv3", name: "QQ飞车" },
  { id: "asv4", name: "地下城与勇士" },
]);
</script>

<style scoped>
.game {
  width: 200px;
  height: 300px;
  background-color: skyblue;
  border-radius: 10px;
  box-shadow: 0 0 10px;
  padding: 10px;
}
h2 {
  background-color: orange;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
}
</style>
